        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>Pair class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="Pair">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/Pair.html">Pair</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>Pair</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class Pair implements Comparable {
 DynamicTreeNode proxyA;
 DynamicTreeNode proxyB;

 /**
  * Constructs a new pair.
  */
 Pair() : proxyA = null, proxyB = null { }

 /**
  * Compares this pair to the other pair. Returns a negative number if this
  * pair is less, 0 if the pairs are equal, and a positive number if this pair
  * is greater. Compared first on which proxyA is less and, in the case of a
  * tie, on which proxyB is less.
  */
 int compareTo(Pair pair2) {
   assert(proxyA != null &amp;&amp; pair2.proxyA != null);
   if (this.proxyA.key &lt; pair2.proxyA.key)
     return -1;

   if (this.proxyA.key == pair2.proxyA.key) {
     return (proxyB.key &lt; pair2.proxyB.key) ? -1 :
         (proxyB.key == pair2.proxyB.key) ? 0 : 1;
   }

   return 1;
 }
}
</pre>
</div>
<h3>Implements</h3>
<p>
<span class="type-box"><span class="icon-class"></span><a href="../dart_core/Comparable.html">Comparable</a></span></p>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="Pair">
<button class="show-code">Code</button>
new <strong>Pair</strong>() <a class="anchor-link" href="#Pair"
              title="Permalink to Pair.Pair">#</a></h4>
<div class="doc">
<p>Constructs a new pair.</p>
<pre class="source">
Pair() : proxyA = null, proxyB = null { }
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="proxyA">
<button class="show-code">Code</button>
<a href="../box2d/DynamicTreeNode.html">DynamicTreeNode</a>         <strong>proxyA</strong> <a class="anchor-link"
            href="#proxyA"
            title="Permalink to Pair.proxyA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
proxyA
</pre>
</div>
</div>
<div class="field"><h4 id="proxyB">
<button class="show-code">Code</button>
<a href="../box2d/DynamicTreeNode.html">DynamicTreeNode</a>         <strong>proxyB</strong> <a class="anchor-link"
            href="#proxyB"
            title="Permalink to Pair.proxyB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
proxyB
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="compareTo">
<button class="show-code">Code</button>
int <strong>compareTo</strong>(<a href="../box2d/Pair.html">Pair</a> pair2) <a class="anchor-link" href="#compareTo"
              title="Permalink to Pair.compareTo">#</a></h4>
<div class="doc">
<p>Compares this pair to the other pair. Returns a negative number if this
pair is less, 0 if the pairs are equal, and a positive number if this pair
is greater. Compared first on which proxyA is less and, in the case of a
tie, on which proxyB is less.</p>
<pre class="source">
int compareTo(Pair pair2) {
 assert(proxyA != null &amp;&amp; pair2.proxyA != null);
 if (this.proxyA.key &lt; pair2.proxyA.key)
   return -1;

 if (this.proxyA.key == pair2.proxyA.key) {
   return (proxyB.key &lt; pair2.proxyB.key) ? -1 :
       (proxyB.key == pair2.proxyB.key) ? 0 : 1;
 }

 return 1;
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
